import unittest
from pathlib import Path

from video_summarize_tools.tools import image_tools
from video_summarize_tools.tools.modelscope_service import ModelScopeService


class ImageToolTest(unittest.TestCase):
    def test_image_cut(self):
        service = ModelScopeService("ss")
        box = service.translate_bbox_to_image_coord((318, 75, 679, 250), (1080, 1920))

        img = image_tools.image_cut(Path("/tmp") / "a9b647f0-825b-4831-9f3f-81d5187df50f_9.jpg", (box[0], box[1]), (box[2], box[3]))
        img.save(Path("/tmp") / "cut.png")